package com.yonyou.pmclouds.team.rmiitf;

import com.yonyou.pmclouds.basecom.entity.PageObject;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.team.entity.TeamMemberVO;

import java.util.List;
import java.util.Map;

public interface TeamMemberQuery {
    TeamMemberVO[] queryByProject(String projectid)
            throws BusinessException;

    TeamMemberVO[] queryById(String[] ids)
            throws BusinessException;
    
    TeamMemberVO[] queryByPkUsers(String[] pkUsers)
    		throws BusinessException;

    TeamMemberVO[] queryByProjectAndEnts(String projectid,String[] entids)
            throws BusinessException;

    TeamMemberVO[] queryByProAndPkUsers(String projectid,String[] pkUsers)
            throws BusinessException;

    String[] queryExistMember(String projectid,String[] pkUsers)
            throws BusinessException;

    /**
     * 统计项目下的所有团队成员数
     *
     * @param projectId
     * @return 统计数
     * @throws BusinessException
     */
    int countProjectMembers(String projectId) throws BusinessException;

    /**
     * 根据项目和企业过滤团队成员
     *
     * @param tenantId
     * @param entId      企业
     * @param projectIds
     * @return 一个Map, key为用户+项目，value为团队成员VO
     * @throws BusinessException
     */
    Map<String, TeamMemberVO> queryMembersByEntAndProjects(String tenantId, String entId, String[] projectIds) throws BusinessException;

    /**
     * 根据用户和租户过滤团队成员
     * @param pkUser
     * @return
     * @throws BusinessException
     */
    List<TeamMemberVO> queryByUserAndTenant(String pkUser, String pkTenant) throws BusinessException;

    //查询项目下的项目团队
    TeamMemberVO[] queryByprojects(String[] pkProjects) throws BusinessException;

    TeamMemberVO[] queryByEnterprise(String pkTenant, String pkEnterprise) throws BusinessException;

    /**
     * 查询同时参与多个项目user
     * @param pkProjects
     * @param start
     * @param offset
     * @return
     */
    PageObject<Object> getInnerSectionInfoByProjects (String[] pkProjects, int start, int offset);

}
